export const fetchJobListAPI = () => {
  return new Promise((resolve, reject) => {
    window.electronAPI.getJobList('', (response) => {
      resolve(response)
    });
  
  })
}

export const fetchJobDetailAPI = (lid)=>{
  return new Promise((resolve, reject) => {
    window.electronAPI.getJobDescription({ lid }, (response) => {
      resolve(response.text || '')
    });
  })
}

export const updateJobStatusAPI = ({ids, newStatus}) => {
  return new Promise((resolve, reject) => {
    window.electronAPI.updateJobStatus({ids_to_update: ids, newStatus}, (response) => {
      resolve(response.data || [])
    })
  })
}

export const updateSubmitStatusAPI = (req) => {
  return new Promise((resolve, reject) => {
    window.electronAPI.updateSubmitStatus(req, (response) => {
      resolve(response.data || [])
    })
  })
}

export const updateJobCategoryAPI = (req) => {
  return new Promise((resolve, reject) => {
    window.electronAPI.updateJobCategory(req, (response) => {
      resolve(response.data || [])
    })
  })
}


